package spring.aop;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * 自己写的，参考下面test的逻辑
 * 动态代理的增强方法
 */
public abstract class MyAdvice {

    protected Object target;  //切面类
    protected Method method;  //增强方法

    public MyAdvice(Object target, Method method) {
        this.target = target;
        this.method = method;
    }

    /**
     * 执行增强方法
     * @param chain
     * @return
     */
     public abstract Object execute(MyChain chain, Object[] args) throws InvocationTargetException, IllegalAccessException;
}
